home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / cat.1 / tknewsbiff.1 < prev    next >
Text File  |  1995-07-25  |  23KB  |  529 lines

  1.  
  2.  
  3.  
  4.      TTTTKKKKNNNNEEEEWWWWSSSSBBBBIIIIFFFFFFFF((((1111))))    UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((1111 JJJJaaaannnnuuuuaaaarrrryyyy 1111999999994444))))     TTTTKKKKNNNNEEEEWWWWSSSSBBBBIIIIFFFFFFFF((((1111))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           tknewsbiff - pop up a window when news appears
  10.  
  11.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.           ttttkkkknnnneeeewwwwssssbbbbiiiiffffffff [ _s_e_r_v_e_r _o_r _c_o_n_f_i_g-_f_i_l_e ]
  13.  
  14.      IIIINNNNTTTTRRRROOOODDDDUUUUCCCCTTTTIIIIOOOONNNN
  15.           ttttkkkknnnneeeewwwwssssbbbbiiiiffffffff pops up a window when there is unread news in
  16.           your favorite newsgroups and removes the window after you've
  17.           read the news.  tknewsbiff can optionally play a sound,
  18.           start your newsreader, etc.
  19.  
  20.  
  21.      SSSSEEEELLLLEEEECCCCTTTTIIIINNNNGGGG NNNNEEEEWWWWSSSSGGGGRRRROOOOUUUUPPPPSSSS
  22.           By default, the configuration file ~/.tknewsbiff describes
  23.           how tknewsbiff behaves.  The syntax observes the usual Tcl
  24.           rules - however, even if you don't know Tcl, all but the
  25.           most esoteric configurations will be obvious.
  26.  
  27.           Each newsgroup (or set of newsgroups) to be watched is
  28.           described by using the "watch" command.  For example:
  29.  
  30.  
  31.           watch dc.dining
  32.           watch nist.*
  33.           watch comp.unix.wizard  -threshold 3
  34.           watch *.sources.*       -threshold 20
  35.  
  36.  
  37.           For each newsgroup pattern, any newsgroup that matches it
  38.           and which you are subscribed to (according to your newsrc
  39.           file) is eligible for reporting.  By default, tknewsbiff
  40.           reports on the newsgroup if there is at least one unread
  41.           article.  The "-threshold" flag changes the threshold to the
  42.           following number.  For example, "-threshold 3" means there
  43.           must be at least three articles unread before tknewsbiff
  44.           will report the newsgroup.
  45.  
  46.           If no watch commands are given (or no configuration file
  47.           exists), all groups which are subscribed to are watched.
  48.  
  49.           To suppress newsgroups that would otherwise be reported, use
  50.           the "ignore" command.  For example, the following matches
  51.           all comp.* and nist.* newgroups except for nist.posix or .d
  52.           (discussion) groups:
  53.  
  54.  
  55.           watch comp.*
  56.           watch nist.*
  57.           ignore nist.posix.*
  58.           ignore *.d
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 7/23/95)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      TTTTKKKKNNNNEEEEWWWWSSSSBBBBIIIIFFFFFFFF((((1111))))    UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((1111 JJJJaaaannnnuuuuaaaarrrryyyy 1111999999994444))))     TTTTKKKKNNNNEEEEWWWWSSSSBBBBIIIIFFFFFFFF((((1111))))
  71.  
  72.  
  73.  
  74.           The flag "-new" describes a command to be executed when the
  75.           newsgroup is first reported as having unread news.  For
  76.           example, the following lines invoke the UNIX command "play"
  77.           to play a sound.
  78.  
  79.  
  80.           watch dc.dining -new "exec play /usr/local/sounds/yumyum.au"
  81.           watch rec.auto* -new "exec play /usr/local/sounds/vroom.au"
  82.  
  83.  
  84.           You can cut down on the verbosity of actions by defining
  85.           procedures.  For example, if you have many -new flags that
  86.           all play sound files, you could define a sound procedure.
  87.           This would allow the -new specification to be much shorter.
  88.  
  89.  
  90.           proc play {sound} {
  91.                exec play /usr/local/sounds/$sound.au
  92.           }
  93.  
  94.           watch dc.dining -new "play yumyum"
  95.           watch rec.auto* -new "play vroom"
  96.  
  97.  
  98.           As an aside, you can put an "&" at the end of an "exec"
  99.           command to get commands to execute asynchronously.  However,
  100.           it's probably not a good idea to do this when playing sound
  101.           files anyway.
  102.  
  103.           "newsgroup" is a read-only variable which contains the name
  104.           of the newsgroup that is being reported.  This is useful
  105.           when the action is triggered by a pattern.  For example, the
  106.           following line could run the newsgroup name through a speech
  107.           synthesizer:
  108.  
  109.  
  110.           watch * -new {
  111.                exec play herald.au
  112.                exec speak "New news has arrived in $newsgroup."
  113.           }
  114.  
  115.  
  116.           The flag "-display" describes a command to be executed every
  117.           time the newsgroup is reported as having unread news.  The
  118.           special command "display" is the default command.  It
  119.           schedules $newsgroup to be written to tknewsbiff's display
  120.           when it is rewritten.  For example, by explicitly providing
  121.           a -display flag that omits the display command, you can
  122.           disable the display of newsgroups that are already reported
  123.           via -new.
  124.  
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 7/23/95)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      TTTTKKKKNNNNEEEEWWWWSSSSBBBBIIIIFFFFFFFF((((1111))))    UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((1111 JJJJaaaannnnuuuuaaaarrrryyyy 1111999999994444))))     TTTTKKKKNNNNEEEEWWWWSSSSBBBBIIIIFFFFFFFF((((1111))))
  137.  
  138.  
  139.  
  140.           watch dc.dining -new {exec play yumyum.au} -display {}
  141.  
  142.  
  143.           If you want to execute an action repeatedly and _s_t_i_l_l
  144.           display the newsgroup in the default manner, explicitly
  145.           invoke the display command via the -display flag.  For
  146.           example:
  147.  
  148.  
  149.           watch *security* -display {
  150.                exec play red-alert.au
  151.                display
  152.           }
  153.  
  154.  
  155.           Actions associated with the -new and -display flags are
  156.           executed only once for each matching newsgroup.  The command
  157.           executed is the one associated with the first pattern in the
  158.           configuration file that matches and observes the given
  159.           threshold.
  160.  
  161.           Any command that is simply listed in the configuration file
  162.           is executed each time before the update loop in tknewsbiff.
  163.           The reserved (but user-defined) procedure "user" is run
  164.           immediately after the newsgroups are scheduled to be written
  165.           to the display and before they are actually written.
  166.  
  167.           For example, suppose unread articles appear in several
  168.           rec.auto groups and you play the same sound for each one.
  169.           To prevent playing the sound several times in a row, make
  170.           the -new command simply set a flag.  In the user procedure,
  171.           play the sound if the flag is set (and then reset the flag).
  172.  
  173.           The user procedure could also be used to start a newsreader.
  174.           This would avoid the possibility of starting multiple
  175.           newsreaders just because multiple newsgroups contained
  176.           unread articles.  (A check should, of course, be made to
  177.           make sure that a newsreader is not already running.)
  178.  
  179.  
  180.      MMMMOOOORRRREEEE VVVVAAAARRRRIIIIAAAABBBBLLLLEEEESSSS
  181.           The following example lines show variables that can affect
  182.           the behavior of tknewsbiff
  183.  
  184.  
  185.           set delay          120
  186.           set server         news.nist.gov
  187.           set server_timeout 60
  188.           set newsrc         ~/.newsrc
  189.           set width          40
  190.           set height         20
  191.           set active_file    /usr/news/lib/active
  192.  
  193.  
  194.  
  195.      Page 3                                          (printed 7/23/95)
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.      TTTTKKKKNNNNEEEEWWWWSSSSBBBBIIIIFFFFFFFF((((1111))))    UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((1111 JJJJaaaannnnuuuuaaaarrrryyyy 1111999999994444))))     TTTTKKKKNNNNEEEEWWWWSSSSBBBBIIIIFFFFFFFF((((1111))))
  203.  
  204.  
  205.  
  206.           tknewsbiff alternates between checking for unread news and
  207.           sleeping (kind of like many undergraduates).  The "delay"
  208.           variable describes how many seconds to sleep.
  209.  
  210.           The "server" variable names an NNTP news-server.  The
  211.           default is "news".  The "server" variable is only used if
  212.           the "active_file" variable is not set.
  213.  
  214.           The "server_timeout" variable describes how how many seconds
  215.           to wait for a response from the server before giving up.  -1
  216.           means wait forever or until the server itself times out.
  217.           The default is 60 seconds.
  218.  
  219.           The "newsrc" variable describes the name of your .newsrc
  220.           file.  By default, tknewsbiff looks in your home directory
  221.           for a newsrc file.  A server-specific newsrc is used if
  222.           found.  For example, if you have set server to
  223.           "cubit.nist.gov", then tknewsbiff looks for ~/.newsrc-
  224.           cubit.nist.gov.  (This is the Emacs gnus convention - which
  225.           is very convenient when you read news from multiple
  226.           servers.)  If there is no server-specific newsrc, tknewsbiff
  227.           uses ~/.newsrc.
  228.  
  229.           The "width" variable describes the width that tknewsbiff
  230.           will use to display information.  If any newsgroup names are
  231.           long enough, they will be truncated so that the article
  232.           counts can still be shown.  You can manually resize the
  233.           window to see what was truncated.  However, if your
  234.           configuration file sets the width variable, the window will
  235.           be restored to that size the next time that tknewsbiff
  236.           checks for unread news and updates its display.
  237.  
  238.           The "height" variable describes the maximum height that
  239.           tknewsbiff will use to display information.  If fewer
  240.           newsgroups are reported, tknewsbiff will shrink the window
  241.           appropriately.  You can manually resize the window but if
  242.           your configuration file sets the height variable, the window
  243.           will be restored to that size the next time that tknewsbiff
  244.           checks for unread news and updates its display.
  245.  
  246.           The "active_file" variable describes the name of the news
  247.           active file.  If set, the active file is read directly in
  248.           preference to using NNTP (even if the "server" variable is
  249.           set).  This is particularly useful for testing out new
  250.           configuration files since you can edit a fake active file
  251.           and then click button 2 to immediately see how tknewsbiff
  252.           responds (see BUTTONS below).
  253.  
  254.           If the environment variable DOTDIR is set, then its value is
  255.           used as a directory in which to find all dotfiles instead of
  256.           from the home directory.  In particular, this affects the
  257.           tknewsbiff configuration file and the .newsrc file (assuming
  258.  
  259.  
  260.  
  261.      Page 4                                          (printed 7/23/95)
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.      TTTTKKKKNNNNEEEEWWWWSSSSBBBBIIIIFFFFFFFF((((1111))))    UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((1111 JJJJaaaannnnuuuuaaaarrrryyyy 1111999999994444))))     TTTTKKKKNNNNEEEEWWWWSSSSBBBBIIIIFFFFFFFF((((1111))))
  269.  
  270.  
  271.  
  272.           the newsrc variable is not set explicitly).
  273.  
  274.  
  275.      WWWWAAAATTTTCCCCHHHHIIIINNNNGGGG DDDDIIIIFFFFFFFFEEEERRRREEEENNNNTTTT NNNNEEEEWWWWSSSS SSSSEEEERRRRVVVVEEEERRRRSSSS
  276.           To watch multiple servers, run tknewsbiff multiple times.
  277.           (Since you need different .newsrc files and the servers have
  278.           different newsgroups and article numbers anyway, there is no
  279.           point in trying to do this in a single process.)
  280.  
  281.           You can point tknewsbiff at a different server with an
  282.           appropriate argument.  The argument is tried both as a
  283.           configuration file name and as a suffix to the string
  284.           "~/.tknewsbiff-".  So if you want to watch the server
  285.           "kidney", store the tknewsbiff configuration information in
  286.           ~/.tknewsbiff-kidney".  The following two commands will both
  287.           use that configuration file.
  288.  
  289.  
  290.                tknewsbiff kidney
  291.                tknewsbiff ~/.tknewsbiff-kidney
  292.  
  293.  
  294.           In both cases, the actual server to contact is set by the
  295.           value of the server variable in the configuration file.
  296.  
  297.           If no configuration file is found, the argument is used as
  298.           the server to contact.  This allows tknewsbiff to be run
  299.           with no preparation whatsoever.
  300.  
  301.           If the argument is the special keyword "active" (or ends in
  302.           "/active"), it is used as the name of an active file.  This
  303.           is in turn used to initialize the variable "active_file" so
  304.           that tknewsbiff reads from the active file directly rather
  305.           than using NNTP.
  306.  
  307.           Creating your own active file is a convenient way of testing
  308.           your configuration file.  For example, after running the
  309.           following command, you can repeatedly edit your active file
  310.           and trigger the update-now command (either by pressing
  311.           button 2 or setting the delay variable very low) to see how
  312.           tknewsbiff responds.
  313.  
  314.           The active file must follow the format of a real active
  315.           file.  The format is one newsgroup per line.  After the
  316.           newsgroup name is the number of the highest article, the
  317.           lowest article.  Lastly is the letter y or m.  m means the
  318.           newsgroup is moderated.  y means posting is allowed.
  319.  
  320.  
  321.      WWWWIIIINNNNDDDDOOOOWWWW
  322.           When unread news is found, a window is popped up.  The
  323.           window lists the names of the newsgroups and the number of
  324.  
  325.  
  326.  
  327.      Page 5                                          (printed 7/23/95)
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.      TTTTKKKKNNNNEEEEWWWWSSSSBBBBIIIIFFFFFFFF((((1111))))    UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((1111 JJJJaaaannnnuuuuaaaarrrryyyy 1111999999994444))))     TTTTKKKKNNNNEEEEWWWWSSSSBBBBIIIIFFFFFFFF((((1111))))
  335.  
  336.  
  337.  
  338.           unread articles in each (unless suppressed by the -display
  339.           flag).  When there is no longer any unread news, the window
  340.           disappears (although the process continues to run).
  341.  
  342.  
  343.      BBBBUUUUTTTTTTTTOOOONNNNSSSS
  344.           Button or key bindings may be assigned by bind commands.
  345.           Feel free to change them.  The default bind commands are:
  346.  
  347.  
  348.           bind .list <1> help
  349.           bind .list <2> update-now
  350.           bind .list <3> unmapwindow
  351.  
  352.  
  353.           By default button 1 (left) is bound to "help".  The help
  354.           command causes tknewsbiff to pop up a help window.
  355.  
  356.           By default, button 2 (middle) is bound to "update-now".  The
  357.           update-now command causes tknewsbiff to immediately check
  358.           for unread news.  If your news server is slow or maintains a
  359.           very large number of newsgroups, or you have a large number
  360.           of patterns in your configuration file, tknewsbiff can take
  361.           considerable time before actually updating the window.
  362.  
  363.           By default, button 3 (right) is bound to "unmapwindow".  The
  364.           unmapwindow command causes tknewsbiff to remove the window
  365.           from the display until the next time it finds unread news.
  366.           (The mapwindow command causes tknewsbiff to restore the
  367.           window.)
  368.  
  369.           As an example, here is a binding to pop up an xterm and run
  370.           rn when you hold down the shift key and press button 1 in
  371.           the listing window.
  372.  
  373.  
  374.           bind .list <Shift-1> {
  375.                exec xterm -e rn &
  376.           }
  377.  
  378.  
  379.           Here is a similar binding.  However it tells rn to look only
  380.           at the newsgroup that is under the mouse when you pressed
  381.           it.  (The "display_list" variable is described later in this
  382.           man page.)
  383.  
  384.  
  385.           bind .list <Shift-1> {
  386.                exec xterm -e rn [lindex $display_list [.list nearest %y]] &
  387.           }
  388.  
  389.  
  390.  
  391.  
  392.  
  393.      Page 6                                          (printed 7/23/95)
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.      TTTTKKKKNNNNEEEEWWWWSSSSBBBBIIIIFFFFFFFF((((1111))))    UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((1111 JJJJaaaannnnuuuuaaaarrrryyyy 1111999999994444))))     TTTTKKKKNNNNEEEEWWWWSSSSBBBBIIIIFFFFFFFF((((1111))))
  401.  
  402.  
  403.  
  404.      OOOOTTTTHHHHEEEERRRR CCCCOOOOMMMMMMMMAAAANNNNDDDDSSSS AAAANNNNDDDD VVVVAAAARRRRIIIIAAAABBBBLLLLEEEESSSS
  405.           Built-in commands already mentioned are: watch, ignore,
  406.           display, help, update-now, unmapwindow, and mapwindow.
  407.  
  408.           Any Tcl and Tk command can also be given.  In particular,
  409.           the list of newsgroups is stored in the list widget ".list",
  410.           and the scroll bar is stored in the scrollbar widget
  411.           ".scroll".  So for example, if you want to change the
  412.           foreground and background colors of the newsgroup list, you
  413.           can say:
  414.  
  415.  
  416.                .list config -bg honeydew1 -fg orchid2
  417.  
  418.  
  419.           These can also be controlled by the X resource database as
  420.           well.  However, the configuration file allows arbitrarily
  421.           complex commands to be evaluated rather than simple
  422.           assignments.
  423.  
  424.           Certain Tcl/Tk commands can disrupt proper function of
  425.           tknewsbiff.  These will probably be obvious to anyone who
  426.           knows enough to give these commands in the first place.  As
  427.           a simple example, the program assumes the font in the list
  428.           box is of fixed width.  The newsgroups will likely not align
  429.           if you use a variable-width font.
  430.  
  431.           The following variables are accessible and can be used for
  432.           esoteric uses.  All other variables are private.  Private
  433.           variables and commands begin with "_" so you don't need to
  434.           worry about accidental collisions.
  435.  
  436.           The array "db" is a database which maintains information
  437.           about read and unread news.  db($newsgroup,hi) is the
  438.           highest article that exists.  db($newsgroup,seen) is the
  439.           highest article that you have read.
  440.  
  441.           A number of lists maintain interesting information.
  442.           "active_list" is a list of known newsgroups.  "seen_list" is
  443.           a list of newsgroups that have been seen so far as the -new
  444.           and -display flags are being processed.
  445.           "previous_seen_list" is "seen_list" from the previous cycle.
  446.           "ignore_list" is the list of newsgroup patterns to ignore.
  447.           "watch_list" is the list of newsgroup patterns to watch.
  448.           "display_list" is the list of newsgroup will be displayed at
  449.           the next opportunity.
  450.  
  451.  
  452.      UUUUPPPPDDDDAAAATTTTIIIINNNNGGGG YYYYOOOOUUUURRRR FFFFIIIILLLLEEEESSSS
  453.           tknewsbiff automatically rereads your configuration file
  454.           each time it wakes up to check for unread news.  To force
  455.           tknewsbiff to reread the file immediately (such as if you
  456.  
  457.  
  458.  
  459.      Page 7                                          (printed 7/23/95)
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.      TTTTKKKKNNNNEEEEWWWWSSSSBBBBIIIIFFFFFFFF((((1111))))    UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((1111 JJJJaaaannnnuuuuaaaarrrryyyy 1111999999994444))))     TTTTKKKKNNNNEEEEWWWWSSSSBBBBIIIIFFFFFFFF((((1111))))
  467.  
  468.  
  469.  
  470.           are testing a new configuration or have just modified your
  471.           newsrc file), press button 2 in the display (see BUTTONS
  472.           above).
  473.  
  474.  
  475.      CCCCAAAAVVVVEEEEAAAATTTTSSSS
  476.           tknewsbiff defines the number of unread articles as the
  477.           highest existing article minus the highest article that
  478.           you've read.  So if you've read the last article in the
  479.           newsgroup but no others, tknewsbiff thinks there are no
  480.           unread articles.  (It's impossible to do any better by
  481.           reading the active file and it would be very time consuming
  482.           to do this more accurately via NNTP since servers provide no
  483.           efficient way of reporting their own holes in the
  484.           newsgroups.) Fortunately, this definition is considered a
  485.           feature by most people.  It allows you to read articles and
  486.           then mark them "unread" but not have tknewsbiff continue
  487.           telling you that they are unread.
  488.  
  489.  
  490.      UUUUNNNNWWWWAAAARRRRRRRRAAAANNNNTTTTEEEEDDDD CCCCOOOONNNNCCCCEEEERRRRNNNNSSSS
  491.           Your news administrator may wonder if many people using
  492.           tknewsbiff severely impact an NNTP server.  In fact, the
  493.           impact is negligible even when the delay is very low.  To
  494.           gather all the information it needs, tknewsbiff uses a
  495.           single NNTP query - it just asks for the active file.  The
  496.           NNTP server does no computation, formatting, etc, it just
  497.           sends the file.  All the interesting processing happens
  498.           locally in the tknewsbiff program itself.
  499.  
  500.  
  501.      BBBBUUUUGGGGSSSS
  502.           The man page is longer than the program.
  503.  
  504.  
  505.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  506.           "_E_x_p_l_o_r_i_n_g _E_x_p_e_c_t: _A _T_c_l-_B_a_s_e_d _T_o_o_l_k_i_t _f_o_r _A_u_t_o_m_a_t_i_n_g
  507.           _I_n_t_e_r_a_c_t_i_v_e _P_r_o_g_r_a_m_s" by Don Libes, O'Reilly and Associates,
  508.           January 1995.
  509.  
  510.      AAAAUUUUTTTTHHHHOOOORRRR
  511.           Don Libes, National Institute of Standards and Technology
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.      Page 8                                          (printed 7/23/95)
  526.  
  527.  
  528.  
  529.